home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / fmodla13.zip / STORAGE.DEF < prev    next >
Text File  |  1992-01-29  |  819b  |  32 lines

  1. DEFINITION MODULE Storage;
  2.  
  3. (* (C) Copyright 1987 Fitted Software Tools. All rights reserved. *)
  4.  
  5. (*
  6.     This module manages the Modula-2 heap which is defined to be all
  7.     the memory between System.HeapTop and System.MemTop.
  8.     The Storage procedures will keep System.HeapTop up to date as
  9.     the heap expands or shrinks.
  10. *)
  11.  
  12. FROM SYSTEM IMPORT ADDRESS;
  13.  
  14.  
  15. PROCEDURE ALLOCATE( VAR a :ADDRESS; size :CARDINAL );
  16. (*
  17.     allocates size bytes in the heap and returns a pointer to
  18.     that memory block in a.
  19. *)
  20.  
  21. PROCEDURE DEALLOCATE( VAR a :ADDRESS; size :CARDINAL );
  22. (*
  23.     returns a previously allocated memory block of size size
  24.     to the heap.
  25. *)
  26.  
  27. PROCEDURE Available( size :CARDINAL ) :BOOLEAN;
  28. (*
  29.     TRUE if a memory block of size size is available for allocation
  30. *)
  31.  
  32. END Storage.